package com.kaifamiao.demo.d0725.pm;

public class Car {

    // 实例变量每个对象私有
    String name;

    String color;

    String host;


    public Car(){
        this.show();
    }

    public Car(String name, String color, String host){
        // this 实例对象, this 当前对象(谁调用的就是谁)
        this.name = name;
        this.color = color;
        this.host = host;
        this.show();
    }

    public void drive(){
        System.out.println("开车");
    }

    public void run(){
        System.out.println("run()");
    }

    public void show(){
        System.out.println(this.host + "有一辆 " + this.color + " 颜色的" + this.name + " 车");
    }
}
